<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div class="app">
        <h3>今天天气{{info1}}</h3>
        <!-- 可以写简单语句 -->
        <button @click="isHot1 = !isHot1">切换天气</button>
        <br>
        <h3>今天天气{{info}}</h3>
        <button @click="changeWeather">切换天气</button>
    </div>
    <script>
        const vm = new Vue({
            data: {
                isHot: true,
                isHot1: true
            },
            computed: {
                info() {
                    return this.isHot ? '热' : '也就那样'
                },
                info1() {
                    return this.isHot1 ? '热' : '也就那样'
                }
            },
            methods: {
                changeWeather() {
                    this.isHot = !this.isHot
                }
            }
        })
        vm.$mount('.app')
    </script>
</body>

</html>